<?php

namespace App\Models;

use Hyn\Tenancy\Traits\UsesTenantConnection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Models\AssetVendor
 *
 * @property int $id
 * @property string $name
 * @property string|null $description
 * @property string|null $address
 * @property string|null $fax
 * @property string|null $email
 * @property string|null $contact_person_name
 * @property string|null $phone
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Asset[] $assets
 * @property-read int|null $assets_count
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AssetVendor onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereContactPersonName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereDescription($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereEmail($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereFax($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetVendor whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AssetVendor withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AssetVendor withoutTrashed()
 * @mixin \Eloquent
 */
class AssetVendor extends Model
{
    use SoftDeletes, UsesTenantConnection;
    protected $hidden=['created_at', 'deleted_at', 'updated_at'];
    protected $guarded = [];

    public function assets()
    {
        return $this->hasMany(Asset::class, 'vendor_id');
    }
}
